package com.xingongchang.baolebei.protocol;

import java.io.Serializable;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;

@Table(name = "ShouTu")
public class ShouTu extends Model implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Column(name = "mid")
	public int mid;
	@Column(name = "title")
	public String title;
	@Column(name = "showImg")
	public String showImg;
	@Column(name = "is_goods")
	public int is_goods;

	@Column(name = "type")
	public int type;

	@Column(name = "itemid")
	public int itemid;

	public static ShouTu fromJson(JSONObject jsonObject) throws JSONException {
		if (null == jsonObject) {
			return null;
		}
		ShouTu localItem = new ShouTu();
		JSONArray subItemArray;
		localItem.mid = jsonObject.optInt("id");
		localItem.title = jsonObject.optString("title");
		localItem.showImg = jsonObject.optString("show_img");
		localItem.is_goods = jsonObject.optInt("is_goods");
		localItem.type = jsonObject.optInt("type");
		localItem.itemid = jsonObject.optInt("itemid");
		return localItem;
	}

	public int getMid()
	{
		return mid;
	}

	public void setMid(int mid)
	{
		this.mid = mid;
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public String getShowImg()
	{
		return showImg;
	}

	public void setShowImg(String showImg)
	{
		this.showImg = showImg;
	}

	public int getIs_goods()
	{
		return is_goods;
	}

	public void setIs_goods(int is_goods)
	{
		this.is_goods = is_goods;
	}

	public int getType()
	{
		return type;
	}

	public void setType(int type)
	{
		this.type = type;
	}

	public int getItemid()
	{
		return itemid;
	}

	public void setItemid(int itemid)
	{
		this.itemid = itemid;
	}
	

	// public JSONObject toJson() throws JSONException {
	// JSONObject localItemObject = new JSONObject();
	// JSONArray itemJSONArray = new JSONArray();
	// localItemObject.put("id", mid);
	// localItemObject.put("showImg", showImg);
	// localItemObject.put("title", title);
	// localItemObject.put("is_goods", is_goods);
	// return localItemObject;
	// }
	

}
